﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework.Command;
using NServiceBus;
using Framework.Infrastructure;

namespace Framework.Bus.NServiceBus
{
    public static class CommandHandlerExtension
    {
        static IBus Bus
        {
            get
            {
                return IoCFactory.Resolve<IBus>("NSB");
            }
        }
        public static void Reply(this ICommandHandler handler, object message)
        {
            Bus.Reply(message.ToJson());
        }
    }
}
